home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 18 Board & Card Games / DRWPKR.BAS < prev    next >
Encoding:
BASIC Source File  |  2019-04-13  |  5.8 KB  |  225 lines

  1. 1 rem "" draw poker
  2. 5 clr
  3. 20 print:print
  4. 25 print"":print""
  5. 27 print">>>> draw poker <<<<":print
  6. 30 print"CCCCCCCCCCCCCCC"
  7. 32 print"1o 1o 1o 1o a  "
  8. 34 print"AASSXXZZA  "
  9. 36 print"AAASSSXXXZZZ  "
  10. 38 print"AAASSSXXXZZZ  "
  11. 40 print"A ASSXXZZ  A"
  12. 42 print" 1o 1o 1o 1o  a"
  13. 44 print"FFFFFFFFFFFFFFF"
  14. 50 print:print"adapted to vic 20     by j. almon  1983"
  15. 55 print:print""
  16. 60 forz1=1to3000
  17. 65 nextz1
  18. 90 clr
  19. 100 print:print"game rules:"
  20. 110 p9=100
  21. 115 print:print"1.you may draw up to    four cards."
  22. 120 print:print"2.on betting, bet a     zero to call."
  23. 130 print:print"3.bet a negative (-)    number to fold."
  24. 131 print:print:print:print"please standby, while i shuffle the cards.  thank you."
  25. 133 poke36879,202
  26. 135 gosub3100
  27. 138 clr:dim t(13),c9(4),s(4,13),m(5),m1(5),c(5),c1(5)
  28. 139 p9=100
  29. 140 forx=1to4:fori=1to13:s(x,i)=0:nexti:nextx:print
  30. 150 print"":print"cards are reshuffled!":poke36879,28
  31. 151 gosub1400
  32. 160 a9=5:print:print"ante of $5.00"
  33. 162 print:print"you have $";p9
  34. 163 gosub1400
  35. 164 forz1=1to3000
  36. 165 nextz1
  37. 170 forx=1to5:gosub920:m(x)=c:m1(x)=s:nextx:gosub1040
  38. 178 gosub1300
  39. 180 print:print"i'll deal my hand.":print
  40. 190 forx=1to5:gosub920:c(x)=c:c1(x)=s:nextx
  41. 200 gosub1080:c1=t:c2=h9:p1=-5
  42. 208 gosub1400
  43. 210 print"open with a bet";:inputb
  44. 211 gosub1300
  45. 212 ifb<0then210
  46. 214 ifrnd(0)<.2then230
  47. 220 ifint(((t*rnd(0))+1)+((h9*rnd(0))+1)+(t*10))<b-(b/10)then440
  48. 225 forz1=1to2000
  49. 226 nextz1
  50. 227 gosub1400
  51. 230 a9=a9+b:print"i'll accept.":print
  52. 235 gosub1300
  53. 240 print:print"how many cards to     replace";:print:inputk9
  54. 242 gosub1300
  55. 245 ifk9=0then290
  56. 250 forx=1tok9
  57. 260 print"card number";:inputt9:gosub920
  58. 265 gosub1300
  59. 270 ift9<6then280
  60. 275 print"enter card number from 1 to 5.":goto260
  61. 280 m(t9)=c:m1(t9)=s:nextx:gosub1040
  62. 290 gosub1070:forx=1to5:t(m(x))=t(m(x))+1:c9(m1(x))=c9(m1(x))+1
  63. 300 nextx:gosub640:p1=t:gosub800:p2=h9
  64. 310 print:gosub1080:h9=0:ift>3then350
  65. 320 forz=1to5:ifh9=3then340
  66. 322 ift(c(z))<>1then340
  67. 324 h9=h9+1
  68. 330 gosub920:c(z)=c:c1(z)=s
  69. 340 nextz
  70. 350 print"i'll take";h9;"cards.":h8=h9
  71. 355 gosub1400
  72. 360 gosub1080:c1=t:gosub800:c2=h9
  73. 370 b9=int((c1*rnd(0))+(c2*rnd(0))+(c1*10))+int(a9/3)+((k9-h8)*2)+7
  74. 380 b1=0:print
  75. 381 ifrnd(0)<c1*.5then390
  76. 382 b9=99.99
  77. 389 gosub1400
  78. 390 print"how much do you bet";:print:inputb
  79. 395 gosub1300
  80. 400 ifb<-1then570
  81. 402 a9=a9+b1
  82. 410 ifb=0thengosub480:goto540
  83. 420 ifa9+b<b9then460
  84. 422 ifa9+b<b9+(b9/2)then450
  85. 430 ifb9=99.99then450
  86. 440 print"i'm out!":gosub480:goto580
  87. 450 print"i call!":a9=a9+b:gosub480:goto540
  88. 460 b1=int(((b9-a9)/3)*rnd(0))+2:a9=a9+b
  89. 465 forz5=1to2000
  90. 466 nextz5
  91. 467 gosub1300
  92. 468 gosub1400
  93. 470 print"i raise $";b1:goto390
  94. 480 print:print"i had ";:t=c1:gosub820
  95. 481 gosub1300
  96. 482 ift>.99then490
  97. 484 print:goto500
  98. 490 print"high card was a ";:c=c2:gosub1200:print
  99. 495 gosub1400
  100. 500 ifp1=-5then530
  101. 510 print"you had ";:t=p1:gosub820
  102. 511 gosub1300
  103. 512 ift>.99then520
  104. 514 print:print:return
  105. 520 print"high card was a ";:c=p2:gosub1200:print
  106. 525 gosub1400
  107. 530 print:return
  108. 540 ifc1=p1then550
  109. 542 ifc1<p1then580
  110. 544 goto570
  111. 550 ifc2=p2then560
  112. 552 ifc2<p2then580
  113. 554 goto570
  114. 560 print"it was a tie!!!":gosub1300:gosub1400:goto590
  115. 570 print"i won $";a9:p9=p9-a9:gosub1400:gosub1400:goto590
  116. 580 print"you won $";a9:p9=p9+a9:gosub1300:gosub1300
  117. 590 print:print"again? (y=yes)";:inputb$:ifb$="y"then140
  118. 600 print:ifp9<0then630
  119. 610 ifp9=>101then620
  120. 612 print"you left losing $";100-p9:gosub1400:gosub1400:gosub1400:goto1100
  121. 619 print""
  122. 620 print:print:print:print"congratulations, you  left winning $";p9:gosub3100:goto1100
  123. 630 print"you owe me $;-p9:goS1300:goS1400:goS1300:gO1100
  124. 640 t=0:fori=1to4:ifc9(i)<>5then650
  125. 642 t=5
  126. 650 nexti:i=2:h9=0
  127. 660 i=i-1:ifi<>0then670
  128. 662 i=13
  129. 670 ift(i)<1then660
  130. 672 h9=1
  131. 675 ifi<>1then680
  132. 677 i=14
  133. 680 z=i-4
  134. 690 i=i-1:ift(i)<>1then720
  135. 700 ifz<>1then690
  136. 710 t=t+4:ifz<>10then720
  137. 712 ift=4then170
  138. 714 t=t+1
  139. 720 ifi=13then660
  140. 722 ift<>5then730
  141. 724 ift(1)<>1then730
  142. 726 h9=1
  143. 730 ift=0then740
  144. 732 return
  145. 740 fori=1to13:ift(i)<>4then750
  146. 745 t=7
  147. 750 ift(i)<>3then760
  148. 752 t=t+5:h9=i
  149. 760 ift(i)<>2then790
  150. 762 ift=5then780
  151. 764 ift<>0then770
  152. 766 h9=0
  153. 770 ifh9=1then780
  154. 772 ifh9>ithen780
  155. 774 h9=i
  156. 780 t=t+1
  157. 790 nexti
  158. 792 ift<>5then810
  159. 794 t=3:return
  160. 800 ifh9<>1then810
  161. 802 h9=14
  162. 810 return
  163. 820 ift=0thenprint"nothing":return
  164. 830 ift=1thenprint"one pair":return
  165. 840 ift=2thenprint"two pair":return
  166. 850 ift=3thenprint"3 of a kind":return
  167. 860 ift=4thenprint"straight":return
  168. 870 ift=5thenprint"flush":return
  169. 880 ift=6thenprint"full house":return
  170. 890 ift=7thenprint"4 of a kind":return
  171. 900 ift=9thenprint"straight -":print"flush.":return
  172. 910 print"royal flush!!!":return
  173. 920 s=int(4*rnd(0))+1:c=int(13*rnd(0))+1
  174. 930 ifs(s,c)=1then920
  175. 932 s(s,c)=1:return
  176. 940 forz1=1to500
  177. 942 nextz1
  178. 945 ifc=1thenprint"a ";:return
  179. 950 ifc=11thenprint"j ";:return
  180. 960 ifc=12thenprint" q ";:return
  181. 970 ifc=13thenprint" k ";:return
  182. 980 ifc=14thenprint" a ";:return
  183. 990 printc;:return
  184. 1000 rem
  185. 1005 ifs=1thenprint"S":return
  186. 1010 ifs=2thenprint"A":return
  187. 1020 ifs=3thenprint"Z":return
  188. 1030 print"X":return
  189. 1040 print"":print"here is your hand:":print:forx=1to5
  190. 1050 c=m(x):s=m1(x):print"card";x;"is a ";:gosub940:gosub1000
  191. 1055 gosub1400
  192. 1060 nextx:return
  193. 1070 forx=1to4:c9(x)=0:nextx:forx=1to13:t(x)=0:nextx:return
  194. 1080 gosub1070:forx=1to5:t(c(x))=t(c(x))+1
  195. 1090 c9(c1(x))=c9(c1(x))+1:nextx:gosub640:return
  196. 1100 end
  197. 1150 print:print"i had ";:t=c1:gosub820
  198. 1160 print"high card was ";:c=c2:gosub940:gosub1000:print:return
  199. 1200 rem
  200. 1205 ifc=1thenprint"ace":return
  201. 1210 ifc=2thenprint"duece":return
  202. 1220 ifc=11thenprint"jack":return
  203. 1230 ifc=12thenprint"queen":return
  204. 1240 ifc=13thenprint"king":return
  205. 1250 ifc=14thenprint"ace":return
  206. 1260 printc"":return
  207. 1300 rem lo
  208. 1305 poke36878,15
  209. 1310 forz5=1to10
  210. 1315 poke36874,240
  211. 1320 nextz5
  212. 1325 poke36874,0
  213. 1330 poke36878,0
  214. 1335 return
  215. 1400 rem hi
  216. 1405 poke36878,15
  217. 1410 forz5=1to10
  218. 1415 poke36875,240
  219. 1420 nextz5
  220. 1425 poke36875,0
  221. 1430 poke36878,0
  222. 1435 return
  223. 3100 rem
  224. 3110 return
  225.